﻿@model IEnumerable<SaleSoft.Models.ds_banner>

@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/administrator/Views/Shared/_Layout.cshtml";
}
<div class="bPageTitle">
    <div class="ptBody">
        <div class="content">
            <img src="/s.gif" alt="NhomQuanTri" class="pageTitleIcon" title="NhomQuanTri"><h1 class="pageType">
                Danh sách<span class="titleSeparatingColon">:</span></h1>
            <h2 class="pageDescription">
                Banner</h2>
            <div class="blank">
                &nbsp;</div>
        </div>
    </div>
    <div class="ptBreadcrumb">
    </div>
</div>
<div class="hotListElement">
    <div class="bPageBlock secondaryPalette">
        <div class="pbHeader">
             <table border="0" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td class="pbTitle">
                            <img src="/s.gif" alt="" width="1" height="1" class="minWidth" title="" />
                        </td>
                        <td class="pbButton">
                            @Html.ActionLink("Thêm banner", "Create", null, new
                       {
                           @class = "btn"
                       })
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="pbBody">
            @*<div id="head_1_ep" class="pbSubheader first tertiaryPalette">
                <h3>
                    Tìm kiếm<span class="titleSeparatingColon"></span></h3>
            </div>*@
            <div class="pbSubsection">
                @using (Html.BeginForm()) {
                    @*<table class="detailList" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td class="labelCol">
                                Ngân hàng
                            </td>
                            <td width="150px">
                                @Html.TextBoxFor(model => model.NganHang, new {
                               style = "width:400px"
                           })
                            </td>
                            <td class="labelCol">
                            </td>
                            <td width="150px">
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td class="labelCol">
                                Tên tài khoản
                            </td>
                            <td width="150px">
                                 @Html.TextBoxFor(model => model.TenTaiKhoan, new {
                               style = "width:400px"
                           })
                            </td>
                            <td class="labelCol">
                            </td>
                            <td width="150px">
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr style="height: 50px">
                            <td>
                            </td>
                            <td colspan="3" style="padding: 15px 15px 15px 15px">
                                <input type="submit" class="btn" style="width: 100px" name="btnSave" value="Tìm tài khoản" />
                                @*<input type="button" value="Clear search" onclick="clearSearch();" class="btn" style="width:100px;" />
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>*@
                    <table class="detailList" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                @(Html.Telerik().Grid(Model)
                                .Name("grdAdmnGroup")
                                .DataKeys(k => k.Add(c => c.id_banner))
                                .Sortable()
                                .Selectable(selecting => selecting.Enabled(true))
                                .DataBinding(databinding =>
                                {
                                    databinding.Server()
                                        .Select("Index", "Banner");
                                })
                                .Editable(editing => editing.Mode(GridEditMode.InLine))
                                 .Columns(col =>
                                 {
                                     col.Bound(o => o.tenbanner)
                                         .Template(@<text>
                                            <img src="@Href("~/UploadImages/")@item.hinhbanner" alt="@item.tenbanner" title="@item.tenbanner" width="80" />
                                         </text>)
                                         .Width(80)
                                         .Title("Banner");
                                     col.Bound(o => o.tenbanner)
                                         .HtmlAttributes(new { @style = "vertical-align: middle;"})
                                         .Title("Tên");
                                     col.Bound(o => o.ds_trangthai.tentrangthai)
                                         .HtmlAttributes(new { @style = "vertical-align: middle;" })
                                         .Title("Trạng thái")
                                         .Width(70);
                                     col.Template(@<div style="text-align:center;">
                                        <a href="/administrator/Banner/edit/@item.id_banner" title="Edit">
                                            <img src="@Href("~/Content/images/icons/pencil.png")" alt="Edit" /></a>
                                        <a href="/administrator/Banner/delete/@item.id_banner" title="Delete" onclick="return confirm('Do you want to delete these data?');">
                                            <img src="@Href("~/Content/images/icons/cross.png")" alt="Delete" /></a></div>)
                                        .Width(80)
                                        .HtmlAttributes(new { @style = "vertical-align: middle;" });
                         })
                            .Pageable(paging => paging.Enabled(true).PageSize(10).Style(GridPagerStyles.NextPreviousAndInput))
                            .Resizable(r => r.Columns(true))
                            .Filterable()
                            .Reorderable(r => r.Columns(true))
                            .Groupable()                            
                        )
                            </td>
                        </tr>
                    </table>
                }
            </div>
            <div class="pbFooter secondaryPalette">
                <div class="bg">
                </div>
            </div>
        </div>
    </div>
</div>
